<include file="Public:header" />
<include file="Quanxian:menu" />
<script type="text/javascript">
    $(function(){
        $('[name=qx_px_no]').focus();
        $('#save').click(function(){
            var qx_px_no=$('#qx_px_no').val();
            var qx_name=$('#qx_name').val();
            if(check(qx_px_no,qx_name)){
                $("form:first").submit();
            }
        });

        function check(qx_px_no,qx_name){
            if(qx_px_no==''){
                $('#pop').html('请填写排序号！');
                $('[name=qx_px_no]').focus();
                return false;
            }
            if(qx_name==''){
                $('#pop').html('请填写权限组名称！');
                $('[name=qx_name]').focus();
                return false;
            }
            if(!isNumber(qx_px_no)){
                $('#pop').html('排序号必须为数值型！');
                $('[name=qx_px_no]').focus();
                return false;
            }
            return true;
        }

        function isNumber(field)
         {
            var   Ret   =   true;
            var   NumStr= "0123456789 ";
            var   chr;
            for   (i=0;i <field.length;++i)
            {
            chr=field.charAt(i);
            if   (NumStr.indexOf(chr,0)==-1)
            {
            Ret=false;
            }
            }
            return(Ret); 
        }
    });
</script>
<div class="body">
    <b>新建权限组</b><br />
    <form name="add" action="{:U('quanxian/save_qx')}" method="POST">
    <span id="pop" style="color:red;"></span><br />
    排序号：<input type="text" size="5" id="qx_px_no" name="qx_px_no" /><br />
    权限组名称：<input type="text" size="15" id="qx_name" name="qx_name" />
    <br/><br />
    <input id="save" value="确定" type="button" />
    </form>
    <br />
    <br />
    提示：请合理设置权限组排序号，它决定了权限组的排列位置，序号越小，所处越高
</div>
<include file="Public:ender" />